<?php
/**
 * Created by PhpStorm.
 * User: MR_THONG
 * Date: 3/1/2015
 * Time: 8:57 AM
 */

App::uses('AppController', 'Controller');

class OtherController extends AppController
{
    function introduce()
    {
        $this->loadHeaderData();
    }
    function contactus(){
        $this->loadHeaderData();
    }
    function setcontact(){

        $this->loadHeaderData();
        $params = $this->data;
        $this->loadModel('CustomerContact');
        $this->CustomerContact->set('customername',$params['Post']['customername']);
        $this->CustomerContact->set('customeremail',$params['Post']['customeremail']);
        $this->CustomerContact->set('customerphone',$params['Post']['customerphone']);
        $this->CustomerContact->set('customercompany',$params['Post']['customercompany']);
        $this->CustomerContact->set('customeraddress',$params['Post']['customeraddress']);
        $this->CustomerContact->set('customerrequest',$params['Post']['customerrequest']);
        $this->CustomerContact->save();


//        $this->loadModel('Contact');
//        $this->Contact->set('name',$params['Post']['contactname']);
//        $this->Contact->set('email',$params['Post']['contactemail']);
//        $this->Contact->set('title',$params['Post']['contacttitle']);
//        $this->Contact->set('information',$params['Post']['contactinfo']);
//        if ($this->Contact->save()){
//            $message = "Ban da lien he thanh cong, Chung toi se lien lac voi ban trong vong 24h toi";
//        }else{$message = "Loi lien lac, xin vui long dang ki lai sau";}
//        $this->set('messagecontact',$message);
    }
}